import {
	request
} from './request.js' //导入封装好的js文件

//登录  post请求
export const login = (data) => {
	return request({
		url: 'wx-api/login',
		method: 'post',
		data: data
	})
}

//用户信息  get请求 
export const getBroadcastList = () => {
	return request({
		url: '/broadcast/get',
	})
}

//首页文章信息  get请求 
export const getPostList = () => {
	return request({
		url: '/post/get',
	})
}

export const getContent = (id) => {
	return request({
		url: '/post/getContent/?id=' + id
	})
}

export const getComment = (id) => {
	return request({
		url: '/comment/get/?postId=' + id
	})
}
export const delCom = (id) => {
	return request({
		url: '/comment/delete/?id=' + id,
		method: 'delete',
	})
}
export const searchApi = (title) => {
	return request({
		url: '/post/search/?title=' + title,
		method: 'post',
	})
}
export const updatePost = (data) => {
	return request({
		url: '/post/update',
		method: 'post',
		data: data
	})
}
export const addComment = (data) => {
	return request({
		url: '/comment/add',
		method: 'post',
		data: data
	})
}
export const getCulture = () => {
	return request({
		url: '/culture/get',
	})
}
